//
//  CMDBCommentView.swift
//  CMDB
//
//  Created by 曹桂祥 on 17/4/15.
//  Copyright © 2017年 CMDB. All rights reserved.
//

import UIKit

class CMDBCommentView: UITextView {

    // MARK:- 懒加载属性
    lazy var placeHolderLabel : UILabel = UILabel()
    
    required override init(frame: CGRect,textContainer: NSTextContainer?) {
        super.init(frame: frame,textContainer: textContainer)
        
        font = CMDB_14_FONT
        
        setupUI()
    }
    
    
    
    // MARK:- 构造函数
    required init?(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)
        
        setupUI()
    }
}

extension CMDBCommentView{
    
    private func setupUI() {
        // 1.添加子控件
        addSubview(placeHolderLabel)
        
        // 2.设置frame
        placeHolderLabel.snp_makeConstraints { (make) -> Void in
            make.top.equalTo(8)
            make.left.equalTo(11)
        }
        
        // 3.设置placeholderLabel属性
        placeHolderLabel.textColor = UIColor.lightGrayColor()
        placeHolderLabel.font = CMDB_14_FONT
        
        // 4.设置placeholderLabel文字
        placeHolderLabel.text = "分享新鲜事..."
        
        // 5.设置内容的内边距
        textContainerInset = UIEdgeInsets(top: 9, left: 6, bottom: 0, right: 7)
    }

    
}
